<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/admin-head"/>
<head>
    <title>闲闲二手交易网站后台 | 添加用户</title>
    <meta content="Preview page of Metronic Admin Theme #1 for twitter input auto complete" name="description" />
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <link href="/assets/metronic/global/plugins/typeahead/typeahead.css" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- END HEAD -->
</head>
<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
<div class="page-wrapper">
    <!-- 导航栏 -->
    <div class="page-header navbar navbar-fixed-top">
        <div class="page-header-inner ">
            <div class="page-logo">
                <a href="javascript:location.reload()" style="margin-top: 14px;margin-left: 10px">
                    <span style="font-size: 20px;">XX-Transaction</span>
                </a>
                <div class="menu-toggler sidebar-toggler" style="position: relative;bottom: -15px">
                    <span></span>
                </div>
            </div>
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
                <span></span>
            </a>
        </div>
    </div>
</div>
<!-- 功能列表 -->
<div class="page-container">
    <div th:replace="common/admin-menu"/>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="theme-panel hidden-xs hidden-sm">
                <div class="toggler-close"> </div>
            </div>
            <!-- BEGIN PAGE BAR -->
            <div class="page-bar">
                <ul class="page-breadcrumb">
                    <li>
                        <a href="home">首页</a>
                        <i class="fa fa-circle"></i>
                    </li>
                    <li>
                        <span>卖家管理 /</span>

                    </li>
                    <li>
                        <span>添加卖家</span>
                    </li>
                </ul>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet light form-fit bordered">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-user-plus"></i>
                                <span class="caption-subject font-dark bold uppercase">填写相关信息</span>
                            </div>
                            <a href="/user/list"  class="btn blue" style="float: right">返回</a>
                        </div>
                        <div class="portlet-body form">
                            <form action="/seller/save" id="form-username" class="form-horizontal form-bordered" method="post">
                                <input type="hidden" name="id" th:value="${seller.id}"/>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">卖家名</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-user"></i>
                                                        </span>
                                            <input type="text" id="sellerName" name="sellerName" class="form-control" th:value="${seller.sellerName}" placeholder="请输入卖家名" required >
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">密码</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-font"></i>
                                                        </span>
                                            <input type="text" id="password" name="password"  class="form-control" th:value="${seller.password}" placeholder="请输入密码" required> </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">邮箱</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa fa-envelope"></i>
                                                        </span>
                                            <input type="text" id="email" name="email"  class="form-control" th:value="${seller.email}" placeholder="请输入邮箱" required> </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">手机</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-mobile"></i>
                                                        </span>
                                            <input type="text" id="phone" name="phone"  class="form-control" th:value="${seller.phone}" placeholder="请输入手机号码" > </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">城市</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-building-o"></i>
                                                        </span>
                                            <input type="text" id="city" name="city"  class="form-control" th:value="${seller.city}" placeholder="请输入所在城市" required> </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">信誉</label>
                                    <div class="col-sm-4">
                                        <div class="input-group">
                                                        <span class="input-group-addon">
                                                            <i class="fa fa-diamond"></i>
                                                        </span>
                                            <input type="text" id="reputation" name="reputation"  class="form-control" th:value="${seller.reputation}" placeholder="选择信誉等级" required> </div>
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <div class="row">
                                        <div class="col-md-offset-3 col-md-9">
                                            <button type="submit" class="btn green" id="save" >
                                                <i class="fa fa-check"></i>保存</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <!-- END PORTLET-->
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/assets/metronic/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/js.cookie.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="/assets/metronic/global/plugins/typeahead/handlebars.min.js" type="text/javascript"></script>
<script src="/assets/metronic/global/plugins/typeahead/typeahead.bundle.min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN THEME GLOBAL SCRIPTS -->
<script src="/assets/metronic/global/scripts/app.min.js" type="text/javascript"></script>
<!-- END THEME GLOBAL SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="/assets/metronic/pages/scripts/components-typeahead.min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME LAYOUT SCRIPTS -->
<script src="/assets/metronic/layouts/layout/scripts/layout.min.js" type="text/javascript"></script>
<script src="/assets/metronic/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
<script src="/assets/metronic/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
<script src="/assets/metronic/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
<!-- 引入validate插件、错误提示-->
<script src="/assets/metronic/js/validate/jquery.validate.min.js" type="text/javascript"></script>
<script>
    //验证
    $("#save").click(function (event) {//点击事件
        var user_password = $.trim($("#password").val());
        var user_phone = $.trim($("#phone").val());
        var passwordreg = /^[a-zA-Z0-9]{4,10}$/;
        var phonereg = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
        if(passwordreg.test(user_password)==false||phonereg.test(user_phone)==false){
            event.preventDefault();//禁止继续提交表单
            alert("请输入正确的用户名、密码或手机号码")
        }
    });
</script>
</body>
</html>
